home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / bin / post_unpack < prev    next >
Encoding:
Text File  |  1997-07-08  |  5.9 KB  |  186 lines

  1. #!/bin/sh
  2. #
  3. #    $Id: post_unpack,v 1.23 1997/04/09 18:45:43 beth Exp $
  4. #
  5. # unpack_idl
  6. #
  7. # This script expects to be run from the top level RSI directory
  8. # after IDL has been unpacked from the distribution media. It performs
  9. # tasks that need to be run on the target machine to complete localization.
  10. #
  11. #    $1 - If $1 is non-empty, this script assumes that it's being
  12. #         run directly from the tty and offers the user the option
  13. #         of trimming excess binaries from the IDL tree. Otherwise, it
  14. #         limits itself to non-interactive setup tasks.
  15.  
  16. VERSION=5
  17. IDL_DIR=`pwd`/idl_$VERSION
  18. IDL_BIN=$IDL_DIR/bin
  19. SCRIPT=`basename $0`
  20. UDIR=`pwd`
  21.  
  22.  
  23. # Generate idldemo command.
  24. echo "#! /bin/sh
  25. # Defines the environment variables required to get an unlicensed IDL
  26. # residing in a non-standard location up and running the IDL demo. This
  27. # lets people give IDL a quick demo without having to get installation
  28. # and license management done first.
  29. #
  30.  
  31. IDL_DIR=$IDL_DIR
  32. IDL_PATH=+\$IDL_DIR/lib:\$IDL_DIR/examples/demo
  33. IDL_DEVICE=X
  34. export IDL_DIR IDL_PATH IDL_DEVICE
  35.  
  36. if [ ! -f \$IDL_DIR/lib/hook/demo.sav ]; then
  37.    echo \"    The IDL Demos have not been installed.  Please consult the
  38.     installation guide for instructions on installing the demos.\"
  39.    exit 0
  40. fi
  41.  
  42. \$IDL_DIR/bin/idl -em=\$IDL_DIR/lib/hook/demo.sav" > $IDL_BIN/idldemo
  43. chmod 755 $IDL_BIN/idldemo
  44.  
  45. # Generate insight command.
  46. echo "#! /bin/sh
  47. # Defines the environment variables required to run insight
  48. #
  49.  
  50. IDL_DIR=$IDL_DIR
  51. if [ \"\$IDL_PATH\" = \"\" ]; then
  52.     IDL_PATH=\"+\$IDL_DIR/lib:+\$IDL_DIR/examples\"
  53. else
  54.     IDL_PATH=\"+\$IDL_DIR/lib:+\$IDL_DIR/examples:\$IDL_PATH\"
  55. fi
  56. IDL_DEVICE=X
  57. export IDL_DIR IDL_PATH IDL_DEVICE
  58. exec \$IDL_DIR/bin/idl \$IDL_DIR/bin/start_insight.txt " > $IDL_BIN/insight
  59.  
  60. chmod 755 $IDL_BIN/insight
  61.  
  62.  
  63. # Generate register command.
  64. echo "#! /bin/sh
  65. # Defines the environment variables required to get an unlicensed IDL
  66. # residing in a non-standard location up and running the Electronic 
  67. # Registration. This registers idl to receive a license file.
  68. #
  69.  
  70. IDL_DIR=$IDL_DIR
  71. IDL_PATH=+\$IDL_DIR/lib
  72. IDL_DEVICE=X
  73. export IDL_DIR IDL_PATH IDL_DEVICE
  74. exec $IDL_DIR/bin/idl -em=$IDL_DIR/lib/register.sav" > $IDL_BIN/rsi_register
  75. chmod 755 $IDL_BIN/rsi_register
  76.  
  77.  
  78. # Create the shell scripts idl_setup and idl_setup.ksh which can be used
  79. # to set up the environment variables and aliases required by IDL
  80. # related commands (idl, idlde, idlhelp, idldemo) if the links to
  81. # the default directory (/usr/local/rsi/idl) are not being used.
  82. #
  83. # C shell users should source idl_setup or envi_setup from their .cshrc files,
  84. # using the full path to the IDL directory as follows:
  85. #    source full_path_to_IDL_Directory/idl_setup
  86. # Korn shell users should run idl_setup.ksh or envi_setup.ksh from their
  87. # .profile file (using the ". idl_setup.ksh" notation), as follows:
  88. #    . full_path_to_IDL_Directory/idl_setup.ksh
  89. #
  90.  
  91. echo "# C shell commands to define IDL environment variables and aliases.
  92. #
  93. # This script can be used by IDL users who use csh as their interactive shell
  94. # to define the environment variables and aliases required by IDL
  95. # related commands (idl, idlde, idlhelp, idldemo) if the symbolic links to
  96. # the default directory (/usr/local/rsi/idl) are not being used.
  97. #
  98. # csh users should source idl_setup from their .cshrc files,
  99. # using the following command:
  100. #
  101. #    source $IDL_DIR/bin/idl_setup
  102. #
  103. setenv IDL_DIR $IDL_DIR
  104. setenv IDL_PATH \+\$IDL_DIR/lib:\+\$IDL_DIR/examples
  105. alias idl \$IDL_DIR/bin/idl
  106. alias idlde \$IDL_DIR/bin/idlde
  107. alias idlhelp \$IDL_DIR/bin/idlhelp
  108. alias idlrpc \$IDL_DIR/bin/idlrpc
  109. alias insight \$IDL_DIR/bin/insight
  110. alias idldemo \$IDL_DIR/bin/idldemo" > $IDL_BIN/idl_setup
  111. chmod 755 $IDL_BIN/idl_setup
  112.  
  113. echo "# Korn shell commands to define IDL environment variables and aliases.
  114. #
  115. # This script can be used by IDL users who use ksh as their interactive shell
  116. # to define the environment variables and aliases required by IDL
  117. # related commands (idl, idlde, idlhelp, idldemo) if the symbolic links to
  118. # the default directory (/usr/local/rsi/idl) are not being used.
  119. #
  120. # ksh users should run idl_setup from their .profile file 
  121. # using the following command:
  122. #
  123. #    . $IDL_DIR/bin/idl_setup.ksh
  124. #
  125. IDL_DIR=$IDL_DIR
  126. export IDL_DIR
  127. IDL_PATH=\+\$IDL_DIR/lib:\+\$IDL_DIR/examples
  128. export IDL_PATH
  129. alias -x idl=\$IDL_DIR/bin/idl
  130. alias -x idlde=\$IDL_DIR/bin/idlde
  131. alias -x idlhelp=\$IDL_DIR/bin/idlhelp
  132. alias -x idlrpc=\$IDL_DIR/bin/idlrpc
  133. alias -x insight=\$IDL_DIR/bin/insight
  134. alias -x idldemo=\$IDL_DIR/bin/idldemo" > $IDL_BIN/idl_setup.ksh
  135. chmod 755 $IDL_BIN/idl_setup.ksh
  136.  
  137.  
  138. # Call script to generate the odbc.ini file for the platforms
  139. # which support it.
  140. $IDL_BIN/gen_odbc_ini $IDL_DIR HP
  141. $IDL_BIN/gen_odbc_ini $IDL_DIR SOLARIS2
  142. $IDL_BIN/gen_odbc_ini $IDL_DIR SUN_OS_4_1
  143. $IDL_BIN/gen_odbc_ini $IDL_DIR AIX
  144. $IDL_BIN/gen_odbc_ini $IDL_DIR SGI
  145.  
  146. if [ "$1" != "" ]; then
  147.  
  148.   # How many sets of binaries are there?
  149.   NUM=0
  150.   for FILE in $IDL_BIN/bin.*; do
  151.     if [ $FILE != "*.tar.Z" ]; then
  152.       NUM=`expr $NUM + 1`
  153.     fi
  154.   done
  155.  
  156.   echo "        This IDL distribution supports $NUM operating
  157.          system/hardware combination(s).
  158. "
  159.  
  160.   # If this distribution supports multiple OS/hardware combinations, offer
  161.   # to remove some of them to save room.
  162.   if [ $NUM != 1 ]; then
  163.     echo "
  164.         This distribution is able to support multiple hardware/operating
  165.         systems. This is done by providing multiple copies of the IDL
  166.         binaries. If you do not need all the combinations present,
  167.         you can remove the unwanted ones and save disk space. You will
  168.         now be given a description of each one and then asked if it
  169.         should be deleted.
  170. "
  171.     if [ `sh $IDL_BIN/yesno "Do you wish to remove excess binaries"` = 1 ]; then
  172.       for FILE in $IDL_BIN/bin.*; do
  173.         if [ -f $FILE/DESCRIP ]; then
  174.           echo " "
  175.           cat $FILE/DESCRIP
  176.           if [ `sh $IDL_BIN/yesno "Delete"` = 1 ]; then
  177.             echo "    Removing " $FILE
  178.             rm -r $FILE
  179.           fi
  180.         fi
  181.       done
  182.     fi
  183.   fi
  184.  
  185. fi
  186.